package thread;

public class ThreadInfoDemo {
    public static void main(String[] args) {
        Thread t = Thread.currentThread();
        System.out.println(t);
        doSomething();
    }

    public static void doSomething(){
        Thread t = Thread.currentThread();
        System.out.println("执行doSomething的进程是:"+t);
        System.out.println("线程的名字是:"+t.getName());
        System.out.println("线程的id是:"+t.getId());
        System.out.println("线程的优先级是:"+t.getPriority());
        System.out.println("线程是否是守护线程:"+t.isDaemon());
        System.out.println("线程是否是活动线程:"+t.isAlive());
        System.out.println("线程是否是中断状态:"+t.isInterrupted());

    }
}
